package com.common.springbootcommonmessage.entity;


import com.common.springbootcommonmessage.enums.AdminRange;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

public class SiteUser {

    private String userName;

    private String email;

    private String site;

    private Integer id;

    private AdminRange range;

    private Integer groupId;

    private String ipAddr;

    private List<String> siteList;

    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param site the site to set
     */
    public void setSite(String site) {
        this.site = site;
    }

    /**
     * @return the site
     */
    public String getSite() {
        return site;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the range
     */
    public AdminRange getRange() {
        return range;
    }

    /**
     * @param range the range to set
     */
    public void setRange(AdminRange range) {
        this.range = range;
    }

    public Boolean isSuperAdmin() {
        return (this.range == AdminRange.SuperAdmin);
    }

    public Boolean isAdmin() {
        return (this.range == AdminRange.Admin || (this.range == AdminRange.SuperAdmin));
    }

    public Boolean isVendor() {
        return this.range == AdminRange.OtherVendor || this.range == AdminRange.Vendor;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public String getIpAddr() {
        return ipAddr;
    }

    public void setIpAddr(String ipAddr) {
        this.ipAddr = ipAddr;
    }

    public List<String> getSiteList() {
        return siteList;
    }

    public void setSiteList(List<String> siteList) {
        this.siteList = siteList;
    }
}